package com.shawn.spring.boot.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 菜单管理
 *
 * @author shawn
 * @since 2020-08-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_menu")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Menu implements Serializable {

  private static final long serialVersionUID = 1L;

  @TableId(value = "menu_id", type = IdType.AUTO)
  private Long menuId;

  /** 父菜单ID，一级菜单为0 */
  private Long parentId;

  /** 菜单名称 */
  private String name;

  /** 菜单URL */
  private String url;

  /** 类型 0：目录 1：菜单 2：按钮 */
  private Integer type;

  /** 排序 */
  private Integer orderNum;

  /** 创建时间 */
  @TableField(fill = FieldFill.INSERT)
  private Date createTime;

  /** 修改时间 */
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Date updateTime;

  /** 状态 0：禁用 1：正常 */
  @TableLogic private Integer isDeleted;
}
